package com.ithei.多线程第二天.阻塞队列等待唤醒机制实现;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker extends Thread {
    ArrayBlockingQueue<String> ab;

    public Cooker(ArrayBlockingQueue<String> ab) {
        this.ab = ab;
    }

    @Override
    public void run() {
        while (true) {
            try {
                ab.put("汉堡包");
                System.out.println("厨师放了汉堡包.....");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
